package com.yunfei.schedule;
import com.yunfei.api.v2.service.AutoAddJiaGaiJobService;
import com.yunfei.utils.ComponentFactory;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
/** 
* @Description: 系统自动加盖管理人公章 系统自动执行，每五分钟一次
* @Author: zhengyunfei
* @Date: 2019/8/27  
* @time:9:56        
*/ 
@Component
public class AutoJiaGaiGongZhangScheduledTask {
    private static final org.slf4j.Logger Logger = LoggerFactory.getLogger(AutoJiaGaiGongZhangScheduledTask.class);
    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-DD HH:mm:ss");
    /**
     * 每隔5分钟执行, 单位：ms。
     */
   @Scheduled(fixedRate = 1000*60*5)
    public void testMyBatis() {
        try {
            AutoAddJiaGaiJobService addJiaGaiJobService = ComponentFactory.getBean(AutoAddJiaGaiJobService.class);
            addJiaGaiJobService.run();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {

        }
    }
}

